<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Client</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
</head>
<body>
<ul class="layui-nav layui-bg-blue" lay-bar="disabled" lay-filter="demo-filter-nav">
    <li class="layui-nav-item"><a href="javascript:;"data-url="../welcome-2.html" >地图</a></li>
    <li class="layui-nav-item"><a href="javascript:;" data-url="../doctor-table.html">挂号</a></li>
    <li class="layui-nav-item"><a href="javascript:;" data-url="../welcome-3.html">药品查看</a></li>
    <li class="layui-nav-item"><a href="java:;" data-url="../user-setting.html">个人中心</a> </li>
</ul>
<iframe id="bi_iframe" src="../welcome-2.html" onload="adjustIframe();" frameborder="0" scrolling="auto"></iframe>
</body>
<script>
    localStorage.setItem("http","http://localhost:9001");
    function adjustIframe(){
        var ifm= document.getElementById("bi_iframe");
        ifm.height=document.documentElement.clientHeight-100;
        ifm.width=document.documentElement.clientWidth-20;
    }
    layui.use(function (){
        $ = layui.$;
        let element = layui.element
        let layer = layui.layer;
        element.on('nav(demo-filter-nav)',function (ele){
            console.log(ele.context.attributes[1].textContent)
            let url = ele.context.attributes[1].textContent
            $('#bi_iframe').attr('src',`${url}`)
            // var ifm = document.getElementById("bi_iframe");
            // console.log(ifm.src)
            // ifm.on('load', function() {
            //     ifm.get(0).contentWindow.location.reload();
            // });
        })
    })
</script>
</html>
